import { getip } from "@/util/tools";
import { Application, IBoot } from "egg";

export default class FooBoot implements IBoot {
  private readonly app: Application;
  constructor(app: Application) {}

  // Ready to call configDidLoad,
  // Config, plugin files are referred,
  // this is the last chance to modify the config.
  configWillLoad() {}

  // Config, plugin files have loaded.
  configDidLoad() {}

  // All files have loaded, start plugin here.
  async didLoad() {}

  // All plugins have started, can do some thing before app ready.
  async willReady() {}

  // Worker is ready, can do some things
  // don't need to block the app boot.
  async didReady() {}

  // Server is listening.
  async serverDidReady() {
    // const ctx = this.app.createAnonymousContext();
    // await ctx.service.notify.restartNotifyStore();
  }

  // Do some thing before app close.
  async beforeClose() {}
}
